package Border;


import static org.junit.Assert.*;

import java.math.BigDecimal;
import java.util.Map;

import org.junit.Before;
import org.junit.Test;

import SquarePackage.Direction;
import SquarePackage.Square;
import SquarePackage.TemperatureScale;

/**
 * testClass for the Border Hierarchy.
 * @author Florian
 * @version	1.0
 */
public class BorderTest {

    private Border wall;
    private Border door;
    private Square square;
    private Square square1;
    private Map <Direction,Border> borders;

    /**
     * @throws java.lang.Exception
     */
    @Before
    public void setUp() throws Exception {
            square = new Square(50,new BigDecimal(30), TemperatureScale.CELSIUS);
            square1 = new Square(-30,new BigDecimal(80), TemperatureScale.CELSIUS);
            wall = new Wall(square, Direction.CEILING);
            door = new Door(square1,Direction.EAST);
    }

    @Test(expected = IllegalArgumentException.class)
    public void setSquareIllegalTest(){
            Border wall1 = new Wall(square1,Direction.EAST);
    }
    @Test(expected=IllegalArgumentException.class)
    public void setSquareToManyIllegalTest(){
            wall.setSquare(new Square());
            Square square2 = new Square(123,new BigDecimal(45), TemperatureScale.CELSIUS);
            wall.setSquare(square2);
    }

    @Test
    public void demolishTest(){
            wall.demolish(square);
            assertEquals(null,wall.getIdentifier());
            assertEquals(null,wall.getSecondSquare());
    }

}
